﻿using System;
using System.Collections.Generic;
using Me.Prettyprint.Cassandra.Serializers;
using Me.Prettyprint.Cassandra.Service;
using Me.Prettyprint.Cassandra.Utils;
using Me.Prettyprint.Hector.Api;
using Me.Prettyprint.Hector.Api.Beans;
using Me.Prettyprint.Hector.Api.Factory;
using Me.Prettyprint.Hector.Api.Query;
using Org.Apache.Cassandra.Thrift;

namespace Me.Prettyprint.Cassandra.Model.Thrift
{
    /// <summary>
    /// The same as ColumnQuery, but dynamically inferring the serializers needed to transform the key
    /// and column name to their binary form.
    /// </summary>
    /// <typeparam name="K"></typeparam>
    /// <typeparam name="N"></typeparam>
    /// <typeparam name="V"></typeparam>
    public class ThriftTypeInferringColumnQuery<K, N, V> : ThriftColumnQuery<K, N, V>
    {
        public ThriftTypeInferringColumnQuery(Keyspace keyspace, Serializer<V> valueSerializer) :
            base(keyspace, TypeInferringSerializer<K>.Instance, TypeInferringSerializer<N>.Instance, valueSerializer)
        {
        }
        public ThriftTypeInferringColumnQuery(Keyspace keyspace) :
            base(keyspace, TypeInferringSerializer<K>.Instance, TypeInferringSerializer<N>.Instance, 
            (Serializer<V>) StringSerializer.Instance)
        {
        }
    }
}
